
_echo:     file format elf32-i386


Disassembly of section .text:

00000000 <main>:
#include "stat.h"
#include "user.h"

int
main(int argc, char *argv[])
{
   0:	55                   	push   %ebp
   1:	89 e5                	mov    %esp,%ebp
   3:	57                   	push   %edi
   4:	56                   	push   %esi
   5:	53                   	push   %ebx
   6:	83 e4 f0             	and    $0xfffffff0,%esp
   9:	83 ec 10             	sub    $0x10,%esp
   c:	8b 75 08             	mov    0x8(%ebp),%esi
   f:	8b 7d 0c             	mov    0xc(%ebp),%edi
  int i;

  for(i = 1; i < argc; i++)
  12:	83 fe 01             	cmp    $0x1,%esi
  15:	7e 60                	jle    77 <main+0x77>
  17:	bb 01 00 00 00       	mov    $0x1,%ebx
    printf(1, "%s%s", argv[i], i+1 < argc ? " " : "\n");
  1c:	83 c3 01             	add    $0x1,%ebx
  1f:	39 f3                	cmp    %esi,%ebx
  21:	74 30                	je     53 <main+0x53>
  23:	90                   	nop
  24:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  28:	c7 44 24 0c f6 06 00 	movl   $0x6f6,0xc(%esp)
  2f:	00 
  30:	8b 44 9f fc          	mov    -0x4(%edi,%ebx,4),%eax
  34:	83 c3 01             	add    $0x1,%ebx
  37:	c7 44 24 04 f8 06 00 	movl   $0x6f8,0x4(%esp)
  3e:	00 
  3f:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  46:	89 44 24 08          	mov    %eax,0x8(%esp)
  4a:	e8 e1 03 00 00       	call   430 <printf>
  4f:	39 f3                	cmp    %esi,%ebx
  51:	75 d5                	jne    28 <main+0x28>
  53:	c7 44 24 0c fd 06 00 	movl   $0x6fd,0xc(%esp)
  5a:	00 
  5b:	8b 44 9f fc          	mov    -0x4(%edi,%ebx,4),%eax
  5f:	c7 44 24 04 f8 06 00 	movl   $0x6f8,0x4(%esp)
  66:	00 
  67:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
  6e:	89 44 24 08          	mov    %eax,0x8(%esp)
  72:	e8 b9 03 00 00       	call   430 <printf>
  exit();
  77:	e8 68 02 00 00       	call   2e4 <exit>
  7c:	90                   	nop
  7d:	90                   	nop
  7e:	90                   	nop
  7f:	90                   	nop

00000080 <strcpy>:
#include "user.h"
#include "x86.h"

char*
strcpy(char *s, char *t)
{
  80:	53                   	push   %ebx
  81:	8b 44 24 08          	mov    0x8(%esp),%eax
  char *os;

  os = s;
  while((*s++ = *t++) != 0)
  85:	31 d2                	xor    %edx,%edx
#include "user.h"
#include "x86.h"

char*
strcpy(char *s, char *t)
{
  87:	8b 5c 24 0c          	mov    0xc(%esp),%ebx
  8b:	90                   	nop
  8c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  char *os;

  os = s;
  while((*s++ = *t++) != 0)
  90:	0f b6 0c 13          	movzbl (%ebx,%edx,1),%ecx
  94:	88 0c 10             	mov    %cl,(%eax,%edx,1)
  97:	83 c2 01             	add    $0x1,%edx
  9a:	84 c9                	test   %cl,%cl
  9c:	75 f2                	jne    90 <strcpy+0x10>
    ;
  return os;
}
  9e:	5b                   	pop    %ebx
  9f:	c3                   	ret    

000000a0 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  a0:	56                   	push   %esi
  a1:	53                   	push   %ebx
  a2:	8b 4c 24 0c          	mov    0xc(%esp),%ecx
  a6:	8b 54 24 10          	mov    0x10(%esp),%edx
  while(*p && *p == *q)
  aa:	0f b6 01             	movzbl (%ecx),%eax
  ad:	0f b6 1a             	movzbl (%edx),%ebx
  b0:	84 c0                	test   %al,%al
  b2:	74 24                	je     d8 <strcmp+0x38>
  b4:	38 d8                	cmp    %bl,%al
  b6:	74 11                	je     c9 <strcmp+0x29>
  b8:	eb 2e                	jmp    e8 <strcmp+0x48>
  ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  c0:	83 c1 01             	add    $0x1,%ecx
  c3:	38 d8                	cmp    %bl,%al
  c5:	75 21                	jne    e8 <strcmp+0x48>
    p++, q++;
  c7:	89 f2                	mov    %esi,%edx
}

int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
  c9:	0f b6 41 01          	movzbl 0x1(%ecx),%eax
    p++, q++;
  cd:	8d 72 01             	lea    0x1(%edx),%esi
}

int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
  d0:	0f b6 5a 01          	movzbl 0x1(%edx),%ebx
  d4:	84 c0                	test   %al,%al
  d6:	75 e8                	jne    c0 <strcmp+0x20>
    p++, q++;
  return (uchar)*p - (uchar)*q;
  d8:	0f b6 db             	movzbl %bl,%ebx
}

int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
  db:	31 c0                	xor    %eax,%eax
    p++, q++;
  return (uchar)*p - (uchar)*q;
  dd:	29 d8                	sub    %ebx,%eax
}
  df:	5b                   	pop    %ebx
  e0:	5e                   	pop    %esi
  e1:	c3                   	ret    
  e2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
    p++, q++;
  return (uchar)*p - (uchar)*q;
  e8:	0f b6 db             	movzbl %bl,%ebx
}

int
strcmp(const char *p, const char *q)
{
  while(*p && *p == *q)
  eb:	0f b6 c0             	movzbl %al,%eax
    p++, q++;
  return (uchar)*p - (uchar)*q;
  ee:	29 d8                	sub    %ebx,%eax
}
  f0:	5b                   	pop    %ebx
  f1:	5e                   	pop    %esi
  f2:	c3                   	ret    
  f3:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  f9:	8d bc 27 00 00 00 00 	lea    0x0(%edi,%eiz,1),%edi

00000100 <strlen>:

uint
strlen(char *s)
{
 100:	8b 4c 24 04          	mov    0x4(%esp),%ecx
  int n;

  for(n = 0; s[n]; n++)
 104:	31 c0                	xor    %eax,%eax
 106:	80 39 00             	cmpb   $0x0,(%ecx)
 109:	74 10                	je     11b <strlen+0x1b>
 10b:	31 d2                	xor    %edx,%edx
 10d:	8d 76 00             	lea    0x0(%esi),%esi
 110:	83 c2 01             	add    $0x1,%edx
 113:	80 3c 11 00          	cmpb   $0x0,(%ecx,%edx,1)
 117:	89 d0                	mov    %edx,%eax
 119:	75 f5                	jne    110 <strlen+0x10>
    ;
  return n;
}
 11b:	f3 c3                	repz ret 
 11d:	8d 76 00             	lea    0x0(%esi),%esi

00000120 <memset>:

void*
memset(void *dst, int c, uint n)
{
 120:	57                   	push   %edi
 121:	8b 54 24 08          	mov    0x8(%esp),%edx
}

static inline void
stosb(void *addr, int data, int cnt)
{
  asm volatile("cld; rep stosb" :
 125:	8b 4c 24 10          	mov    0x10(%esp),%ecx
 129:	8b 44 24 0c          	mov    0xc(%esp),%eax
 12d:	89 d7                	mov    %edx,%edi
 12f:	fc                   	cld    
 130:	f3 aa                	rep stos %al,%es:(%edi)
  stosb(dst, c, n);
  return dst;
}
 132:	89 d0                	mov    %edx,%eax
 134:	5f                   	pop    %edi
 135:	c3                   	ret    
 136:	8d 76 00             	lea    0x0(%esi),%esi
 139:	8d bc 27 00 00 00 00 	lea    0x0(%edi,%eiz,1),%edi

00000140 <strchr>:

char*
strchr(const char *s, char c)
{
 140:	8b 44 24 04          	mov    0x4(%esp),%eax
 144:	0f b6 4c 24 08       	movzbl 0x8(%esp),%ecx
  for(; *s; s++)
 149:	0f b6 10             	movzbl (%eax),%edx
 14c:	84 d2                	test   %dl,%dl
 14e:	74 1d                	je     16d <strchr+0x2d>
    if(*s == c)
 150:	38 ca                	cmp    %cl,%dl
 152:	75 0e                	jne    162 <strchr+0x22>
 154:	eb 1c                	jmp    172 <strchr+0x32>
 156:	66 90                	xchg   %ax,%ax
}

char*
strchr(const char *s, char c)
{
  for(; *s; s++)
 158:	83 c0 01             	add    $0x1,%eax
    if(*s == c)
 15b:	38 ca                	cmp    %cl,%dl
 15d:	8d 76 00             	lea    0x0(%esi),%esi
 160:	74 0e                	je     170 <strchr+0x30>
}

char*
strchr(const char *s, char c)
{
  for(; *s; s++)
 162:	0f b6 50 01          	movzbl 0x1(%eax),%edx
 166:	84 d2                	test   %dl,%dl
 168:	75 ee                	jne    158 <strchr+0x18>
    if(*s == c)
      return (char*) s;
  return 0;
 16a:	31 c0                	xor    %eax,%eax
 16c:	c3                   	ret    
 16d:	31 c0                	xor    %eax,%eax
 16f:	90                   	nop
}
 170:	f3 c3                	repz ret 
 172:	f3 c3                	repz ret 
 174:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
 17a:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi

00000180 <gets>:

char*
gets(char *buf, int max)
{
 180:	55                   	push   %ebp
 181:	57                   	push   %edi
 182:	56                   	push   %esi
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 183:	31 f6                	xor    %esi,%esi
  return 0;
}

char*
gets(char *buf, int max)
{
 185:	53                   	push   %ebx
 186:	83 ec 2c             	sub    $0x2c,%esp
 189:	8b 7c 24 40          	mov    0x40(%esp),%edi
 18d:	8b 6c 24 44          	mov    0x44(%esp),%ebp
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 191:	eb 38                	jmp    1cb <gets+0x4b>
 193:	90                   	nop
 194:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    cc = read(0, &c, 1);
 198:	8d 44 24 1f          	lea    0x1f(%esp),%eax
 19c:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
 1a3:	00 
 1a4:	89 44 24 04          	mov    %eax,0x4(%esp)
 1a8:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 1af:	e8 48 01 00 00       	call   2fc <read>
    if(cc < 1)
 1b4:	85 c0                	test   %eax,%eax
 1b6:	7e 1a                	jle    1d2 <gets+0x52>
      break;
    buf[i++] = c;
 1b8:	0f b6 44 24 1f       	movzbl 0x1f(%esp),%eax
gets(char *buf, int max)
{
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 1bd:	89 de                	mov    %ebx,%esi
    cc = read(0, &c, 1);
    if(cc < 1)
      break;
    buf[i++] = c;
    if(c == '\n' || c == '\r')
 1bf:	3c 0d                	cmp    $0xd,%al

  for(i=0; i+1 < max; ){
    cc = read(0, &c, 1);
    if(cc < 1)
      break;
    buf[i++] = c;
 1c1:	88 44 1f ff          	mov    %al,-0x1(%edi,%ebx,1)
    if(c == '\n' || c == '\r')
 1c5:	74 0b                	je     1d2 <gets+0x52>
 1c7:	3c 0a                	cmp    $0xa,%al
 1c9:	74 07                	je     1d2 <gets+0x52>
gets(char *buf, int max)
{
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 1cb:	8d 5e 01             	lea    0x1(%esi),%ebx
 1ce:	39 eb                	cmp    %ebp,%ebx
 1d0:	7c c6                	jl     198 <gets+0x18>
      break;
    buf[i++] = c;
    if(c == '\n' || c == '\r')
      break;
  }
  buf[i] = '\0';
 1d2:	c6 04 37 00          	movb   $0x0,(%edi,%esi,1)
  return buf;
}
 1d6:	83 c4 2c             	add    $0x2c,%esp
 1d9:	89 f8                	mov    %edi,%eax
 1db:	5b                   	pop    %ebx
 1dc:	5e                   	pop    %esi
 1dd:	5f                   	pop    %edi
 1de:	5d                   	pop    %ebp
 1df:	c3                   	ret    

000001e0 <stat>:

int
stat(char *n, struct statt *st)
{
 1e0:	83 ec 1c             	sub    $0x1c,%esp
  int fd;
  int r;

  fd = open(n, O_RDONLY);
 1e3:	8b 44 24 20          	mov    0x20(%esp),%eax
  return buf;
}

int
stat(char *n, struct statt *st)
{
 1e7:	89 5c 24 14          	mov    %ebx,0x14(%esp)
 1eb:	89 74 24 18          	mov    %esi,0x18(%esp)
  int fd;
  int r;

  fd = open(n, O_RDONLY);
  if(fd < 0)
    return -1;
 1ef:	be ff ff ff ff       	mov    $0xffffffff,%esi
stat(char *n, struct statt *st)
{
  int fd;
  int r;

  fd = open(n, O_RDONLY);
 1f4:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
 1fb:	00 
 1fc:	89 04 24             	mov    %eax,(%esp)
 1ff:	e8 20 01 00 00       	call   324 <open>
  if(fd < 0)
 204:	85 c0                	test   %eax,%eax
stat(char *n, struct statt *st)
{
  int fd;
  int r;

  fd = open(n, O_RDONLY);
 206:	89 c3                	mov    %eax,%ebx
  if(fd < 0)
 208:	78 1a                	js     224 <stat+0x44>
    return -1;
  r = fstat(fd, st);
 20a:	8b 44 24 24          	mov    0x24(%esp),%eax
 20e:	89 1c 24             	mov    %ebx,(%esp)
 211:	89 44 24 04          	mov    %eax,0x4(%esp)
 215:	e8 22 01 00 00       	call   33c <fstat>
  close(fd);
 21a:	89 1c 24             	mov    %ebx,(%esp)
  int r;

  fd = open(n, O_RDONLY);
  if(fd < 0)
    return -1;
  r = fstat(fd, st);
 21d:	89 c6                	mov    %eax,%esi
  close(fd);
 21f:	e8 e8 00 00 00       	call   30c <close>
  return r;
}
 224:	89 f0                	mov    %esi,%eax
 226:	8b 5c 24 14          	mov    0x14(%esp),%ebx
 22a:	8b 74 24 18          	mov    0x18(%esp),%esi
 22e:	83 c4 1c             	add    $0x1c,%esp
 231:	c3                   	ret    
 232:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
 239:	8d bc 27 00 00 00 00 	lea    0x0(%edi,%eiz,1),%edi

00000240 <atoi>:

int
atoi(const char *s)
{
 240:	53                   	push   %ebx
 241:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  int n;

  n = 0;
 245:	31 c0                	xor    %eax,%eax
  while('0' <= *s && *s <= '9')
 247:	0f b6 11             	movzbl (%ecx),%edx
 24a:	8d 5a d0             	lea    -0x30(%edx),%ebx
 24d:	80 fb 09             	cmp    $0x9,%bl
 250:	77 1e                	ja     270 <atoi+0x30>
 252:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    n = n*10 + *s++ - '0';
 258:	0f be d2             	movsbl %dl,%edx
 25b:	83 c1 01             	add    $0x1,%ecx
 25e:	8d 04 80             	lea    (%eax,%eax,4),%eax
 261:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
atoi(const char *s)
{
  int n;

  n = 0;
  while('0' <= *s && *s <= '9')
 265:	0f b6 11             	movzbl (%ecx),%edx
 268:	8d 5a d0             	lea    -0x30(%edx),%ebx
 26b:	80 fb 09             	cmp    $0x9,%bl
 26e:	76 e8                	jbe    258 <atoi+0x18>
    n = n*10 + *s++ - '0';
  return n;
}
 270:	5b                   	pop    %ebx
 271:	c3                   	ret    
 272:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
 279:	8d bc 27 00 00 00 00 	lea    0x0(%edi,%eiz,1),%edi

00000280 <memmove>:

void*
memmove(void *vdst, void *vsrc, int n)
{
 280:	56                   	push   %esi
 281:	53                   	push   %ebx
 282:	8b 5c 24 14          	mov    0x14(%esp),%ebx
 286:	8b 44 24 0c          	mov    0xc(%esp),%eax
 28a:	8b 74 24 10          	mov    0x10(%esp),%esi
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 28e:	85 db                	test   %ebx,%ebx
 290:	7e 14                	jle    2a6 <memmove+0x26>
    n = n*10 + *s++ - '0';
  return n;
}

void*
memmove(void *vdst, void *vsrc, int n)
 292:	31 d2                	xor    %edx,%edx
 294:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
    *dst++ = *src++;
 298:	0f b6 0c 16          	movzbl (%esi,%edx,1),%ecx
 29c:	88 0c 10             	mov    %cl,(%eax,%edx,1)
 29f:	83 c2 01             	add    $0x1,%edx
{
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 2a2:	39 da                	cmp    %ebx,%edx
 2a4:	75 f2                	jne    298 <memmove+0x18>
    *dst++ = *src++;
  return vdst;
}
 2a6:	5b                   	pop    %ebx
 2a7:	5e                   	pop    %esi
 2a8:	c3                   	ret    
 2a9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

000002b0 <memcpy>:

void *
memcpy(void *dst, const void *src, uint n)
{
 2b0:	56                   	push   %esi
 2b1:	53                   	push   %ebx
 2b2:	8b 5c 24 14          	mov    0x14(%esp),%ebx
 2b6:	8b 44 24 0c          	mov    0xc(%esp),%eax
 2ba:	8b 74 24 10          	mov    0x10(%esp),%esi
{
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 2be:	85 db                	test   %ebx,%ebx
 2c0:	7e 14                	jle    2d6 <memcpy+0x26>
 2c2:	31 d2                	xor    %edx,%edx
 2c4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    *dst++ = *src++;
 2c8:	0f b6 0c 16          	movzbl (%esi,%edx,1),%ecx
 2cc:	88 0c 10             	mov    %cl,(%eax,%edx,1)
 2cf:	83 c2 01             	add    $0x1,%edx
{
  char *dst, *src;
  
  dst = vdst;
  src = vsrc;
  while(n-- > 0)
 2d2:	39 da                	cmp    %ebx,%edx
 2d4:	75 f2                	jne    2c8 <memcpy+0x18>

void *
memcpy(void *dst, const void *src, uint n)
{
  return memmove(dst, src, n);
}
 2d6:	5b                   	pop    %ebx
 2d7:	5e                   	pop    %esi
 2d8:	c3                   	ret    
 2d9:	90                   	nop
 2da:	90                   	nop
 2db:	90                   	nop

000002dc <fork>:
 2dc:	b8 01 00 00 00       	mov    $0x1,%eax
 2e1:	cd 40                	int    $0x40
 2e3:	c3                   	ret    

000002e4 <exit>:
 2e4:	b8 02 00 00 00       	mov    $0x2,%eax
 2e9:	cd 40                	int    $0x40
 2eb:	c3                   	ret    

000002ec <wait>:
 2ec:	b8 03 00 00 00       	mov    $0x3,%eax
 2f1:	cd 40                	int    $0x40
 2f3:	c3                   	ret    

000002f4 <pipe>:
 2f4:	b8 04 00 00 00       	mov    $0x4,%eax
 2f9:	cd 40                	int    $0x40
 2fb:	c3                   	ret    

000002fc <read>:
 2fc:	b8 06 00 00 00       	mov    $0x6,%eax
 301:	cd 40                	int    $0x40
 303:	c3                   	ret    

00000304 <write>:
 304:	b8 05 00 00 00       	mov    $0x5,%eax
 309:	cd 40                	int    $0x40
 30b:	c3                   	ret    

0000030c <close>:
 30c:	b8 07 00 00 00       	mov    $0x7,%eax
 311:	cd 40                	int    $0x40
 313:	c3                   	ret    

00000314 <kill>:
 314:	b8 08 00 00 00       	mov    $0x8,%eax
 319:	cd 40                	int    $0x40
 31b:	c3                   	ret    

0000031c <exec>:
 31c:	b8 09 00 00 00       	mov    $0x9,%eax
 321:	cd 40                	int    $0x40
 323:	c3                   	ret    

00000324 <open>:
 324:	b8 0a 00 00 00       	mov    $0xa,%eax
 329:	cd 40                	int    $0x40
 32b:	c3                   	ret    

0000032c <mknod>:
 32c:	b8 0b 00 00 00       	mov    $0xb,%eax
 331:	cd 40                	int    $0x40
 333:	c3                   	ret    

00000334 <unlink>:
 334:	b8 0c 00 00 00       	mov    $0xc,%eax
 339:	cd 40                	int    $0x40
 33b:	c3                   	ret    

0000033c <fstat>:
 33c:	b8 0d 00 00 00       	mov    $0xd,%eax
 341:	cd 40                	int    $0x40
 343:	c3                   	ret    

00000344 <link>:
 344:	b8 0e 00 00 00       	mov    $0xe,%eax
 349:	cd 40                	int    $0x40
 34b:	c3                   	ret    

0000034c <mkdir>:
 34c:	b8 0f 00 00 00       	mov    $0xf,%eax
 351:	cd 40                	int    $0x40
 353:	c3                   	ret    

00000354 <chdir>:
 354:	b8 10 00 00 00       	mov    $0x10,%eax
 359:	cd 40                	int    $0x40
 35b:	c3                   	ret    

0000035c <dup>:
 35c:	b8 11 00 00 00       	mov    $0x11,%eax
 361:	cd 40                	int    $0x40
 363:	c3                   	ret    

00000364 <getpid>:
 364:	b8 12 00 00 00       	mov    $0x12,%eax
 369:	cd 40                	int    $0x40
 36b:	c3                   	ret    

0000036c <sbrk>:
 36c:	b8 13 00 00 00       	mov    $0x13,%eax
 371:	cd 40                	int    $0x40
 373:	c3                   	ret    

00000374 <sleep>:
 374:	b8 14 00 00 00       	mov    $0x14,%eax
 379:	cd 40                	int    $0x40
 37b:	c3                   	ret    
 37c:	90                   	nop
 37d:	90                   	nop
 37e:	90                   	nop
 37f:	90                   	nop

00000380 <putc>:
#include "stat.h"
#include "user.h"

static void
putc(int fd, char c)
{
 380:	83 ec 2c             	sub    $0x2c,%esp
 383:	88 54 24 1c          	mov    %dl,0x1c(%esp)
  write(fd, &c, 1);
 387:	8d 54 24 1c          	lea    0x1c(%esp),%edx
 38b:	c7 44 24 08 01 00 00 	movl   $0x1,0x8(%esp)
 392:	00 
 393:	89 54 24 04          	mov    %edx,0x4(%esp)
 397:	89 04 24             	mov    %eax,(%esp)
 39a:	e8 65 ff ff ff       	call   304 <write>
}
 39f:	83 c4 2c             	add    $0x2c,%esp
 3a2:	c3                   	ret    
 3a3:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
 3a9:	8d bc 27 00 00 00 00 	lea    0x0(%edi,%eiz,1),%edi

000003b0 <printint>:

static void
printint(int fd, int xx, int base, int sgn)
{
 3b0:	57                   	push   %edi
 3b1:	56                   	push   %esi
 3b2:	53                   	push   %ebx
 3b3:	89 c3                	mov    %eax,%ebx
 3b5:	83 ec 10             	sub    $0x10,%esp
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
  if(sgn && xx < 0){
 3b8:	8b 44 24 20          	mov    0x20(%esp),%eax
 3bc:	85 c0                	test   %eax,%eax
 3be:	74 60                	je     420 <printint+0x70>
 3c0:	89 d0                	mov    %edx,%eax
 3c2:	c1 e8 1f             	shr    $0x1f,%eax
 3c5:	84 c0                	test   %al,%al
 3c7:	74 57                	je     420 <printint+0x70>
    neg = 1;
    x = -xx;
 3c9:	89 d0                	mov    %edx,%eax
  int i, neg;
  uint x;

  neg = 0;
  if(sgn && xx < 0){
    neg = 1;
 3cb:	bf 01 00 00 00       	mov    $0x1,%edi
    x = -xx;
 3d0:	f7 d8                	neg    %eax
  } else {
    x = xx;
  }

  i = 0;
 3d2:	31 f6                	xor    %esi,%esi
 3d4:	eb 04                	jmp    3da <printint+0x2a>
 3d6:	66 90                	xchg   %ax,%ax
  do{
    buf[i++] = digits[x % base];
 3d8:	89 d6                	mov    %edx,%esi
 3da:	31 d2                	xor    %edx,%edx
 3dc:	f7 f1                	div    %ecx
 3de:	0f b6 92 06 07 00 00 	movzbl 0x706(%edx),%edx
  }while((x /= base) != 0);
 3e5:	85 c0                	test   %eax,%eax
    x = xx;
  }

  i = 0;
  do{
    buf[i++] = digits[x % base];
 3e7:	88 14 34             	mov    %dl,(%esp,%esi,1)
 3ea:	8d 56 01             	lea    0x1(%esi),%edx
  }while((x /= base) != 0);
 3ed:	75 e9                	jne    3d8 <printint+0x28>
  if(neg)
 3ef:	85 ff                	test   %edi,%edi
 3f1:	74 07                	je     3fa <printint+0x4a>
    buf[i++] = '-';
 3f3:	c6 04 14 2d          	movb   $0x2d,(%esp,%edx,1)
 3f7:	8d 56 02             	lea    0x2(%esi),%edx

  while(--i >= 0)
 3fa:	8d 72 ff             	lea    -0x1(%edx),%esi
 3fd:	8d 76 00             	lea    0x0(%esi),%esi
    putc(fd, buf[i]);
 400:	0f be 14 34          	movsbl (%esp,%esi,1),%edx
 404:	89 d8                	mov    %ebx,%eax
    buf[i++] = digits[x % base];
  }while((x /= base) != 0);
  if(neg)
    buf[i++] = '-';

  while(--i >= 0)
 406:	83 ee 01             	sub    $0x1,%esi
    putc(fd, buf[i]);
 409:	e8 72 ff ff ff       	call   380 <putc>
    buf[i++] = digits[x % base];
  }while((x /= base) != 0);
  if(neg)
    buf[i++] = '-';

  while(--i >= 0)
 40e:	83 fe ff             	cmp    $0xffffffff,%esi
 411:	75 ed                	jne    400 <printint+0x50>
    putc(fd, buf[i]);
}
 413:	83 c4 10             	add    $0x10,%esp
 416:	5b                   	pop    %ebx
 417:	5e                   	pop    %esi
 418:	5f                   	pop    %edi
 419:	c3                   	ret    
 41a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  neg = 0;
  if(sgn && xx < 0){
    neg = 1;
    x = -xx;
  } else {
    x = xx;
 420:	89 d0                	mov    %edx,%eax
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
 422:	31 ff                	xor    %edi,%edi
 424:	eb ac                	jmp    3d2 <printint+0x22>
 426:	8d 76 00             	lea    0x0(%esi),%esi
 429:	8d bc 27 00 00 00 00 	lea    0x0(%edi,%eiz,1),%edi

00000430 <printf>:
}

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 430:	55                   	push   %ebp
 431:	57                   	push   %edi
 432:	56                   	push   %esi
 433:	53                   	push   %ebx
 434:	83 ec 2c             	sub    $0x2c,%esp
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
 437:	8b 5c 24 44          	mov    0x44(%esp),%ebx
}

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 43b:	8b 6c 24 40          	mov    0x40(%esp),%ebp
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
 43f:	0f b6 0b             	movzbl (%ebx),%ecx
 442:	84 c9                	test   %cl,%cl
 444:	0f 84 86 00 00 00    	je     4d0 <printf+0xa0>
  char *s;
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
 44a:	8d 44 24 48          	lea    0x48(%esp),%eax
{
  char *s;
  int c, i, state;
  uint *ap;

  state = 0;
 44e:	31 f6                	xor    %esi,%esi
  ap = (uint*)(void*)&fmt + 1;
 450:	89 44 24 1c          	mov    %eax,0x1c(%esp)
 454:	eb 1b                	jmp    471 <printf+0x41>
 456:	66 90                	xchg   %ax,%ax
  for(i = 0; fmt[i]; i++){
    c = fmt[i] & 0xff;
    if(state == 0){
      if(c == '%'){
 458:	83 f9 25             	cmp    $0x25,%ecx
 45b:	74 7b                	je     4d8 <printf+0xa8>
        state = '%';
      } else {
        putc(fd, c);
 45d:	0f be d1             	movsbl %cl,%edx
 460:	89 e8                	mov    %ebp,%eax
 462:	e8 19 ff ff ff       	call   380 <putc>
      } else if(c == '%'){
        putc(fd, c);
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
        putc(fd, c);
 467:	83 c3 01             	add    $0x1,%ebx
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
 46a:	0f b6 0b             	movzbl (%ebx),%ecx
 46d:	84 c9                	test   %cl,%cl
 46f:	74 5f                	je     4d0 <printf+0xa0>
    c = fmt[i] & 0xff;
    if(state == 0){
 471:	85 f6                	test   %esi,%esi
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
    c = fmt[i] & 0xff;
 473:	0f b6 c9             	movzbl %cl,%ecx
    if(state == 0){
 476:	74 e0                	je     458 <printf+0x28>
      if(c == '%'){
        state = '%';
      } else {
        putc(fd, c);
      }
    } else if(state == '%'){
 478:	83 fe 25             	cmp    $0x25,%esi
 47b:	75 ea                	jne    467 <printf+0x37>
      if(c == 'd'){
 47d:	83 f9 64             	cmp    $0x64,%ecx
 480:	0f 84 ba 00 00 00    	je     540 <printf+0x110>
        printint(fd, *ap, 10, 1);
        ap++;
      } else if(c == 'x' || c == 'p'){
 486:	83 f9 70             	cmp    $0x70,%ecx
 489:	74 55                	je     4e0 <printf+0xb0>
 48b:	83 f9 78             	cmp    $0x78,%ecx
 48e:	66 90                	xchg   %ax,%ax
 490:	74 4e                	je     4e0 <printf+0xb0>
        printint(fd, *ap, 16, 0);
        ap++;
      } else if(c == 's'){
 492:	83 f9 73             	cmp    $0x73,%ecx
 495:	74 71                	je     508 <printf+0xd8>
          s = "(null)";
        while(*s != 0){
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
 497:	83 f9 63             	cmp    $0x63,%ecx
 49a:	0f 84 c3 00 00 00    	je     563 <printf+0x133>
        putc(fd, *ap);
        ap++;
      } else if(c == '%'){
 4a0:	83 f9 25             	cmp    $0x25,%ecx
        putc(fd, c);
 4a3:	ba 25 00 00 00       	mov    $0x25,%edx
 4a8:	89 e8                	mov    %ebp,%eax
          s++;
        }
      } else if(c == 'c'){
        putc(fd, *ap);
        ap++;
      } else if(c == '%'){
 4aa:	74 12                	je     4be <printf+0x8e>
        putc(fd, c);
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
 4ac:	89 4c 24 18          	mov    %ecx,0x18(%esp)
 4b0:	e8 cb fe ff ff       	call   380 <putc>
        putc(fd, c);
 4b5:	8b 4c 24 18          	mov    0x18(%esp),%ecx
 4b9:	89 e8                	mov    %ebp,%eax
 4bb:	0f be d1             	movsbl %cl,%edx
 4be:	e8 bd fe ff ff       	call   380 <putc>
      }
      state = 0;
 4c3:	31 f6                	xor    %esi,%esi
      } else if(c == '%'){
        putc(fd, c);
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
        putc(fd, c);
 4c5:	83 c3 01             	add    $0x1,%ebx
  int c, i, state;
  uint *ap;

  state = 0;
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
 4c8:	0f b6 0b             	movzbl (%ebx),%ecx
 4cb:	84 c9                	test   %cl,%cl
 4cd:	75 a2                	jne    471 <printf+0x41>
 4cf:	90                   	nop
        putc(fd, c);
      }
      state = 0;
    }
  }
}
 4d0:	83 c4 2c             	add    $0x2c,%esp
 4d3:	5b                   	pop    %ebx
 4d4:	5e                   	pop    %esi
 4d5:	5f                   	pop    %edi
 4d6:	5d                   	pop    %ebp
 4d7:	c3                   	ret    
  ap = (uint*)(void*)&fmt + 1;
  for(i = 0; fmt[i]; i++){
    c = fmt[i] & 0xff;
    if(state == 0){
      if(c == '%'){
        state = '%';
 4d8:	be 25 00 00 00       	mov    $0x25,%esi
 4dd:	eb 88                	jmp    467 <printf+0x37>
 4df:	90                   	nop
    } else if(state == '%'){
      if(c == 'd'){
        printint(fd, *ap, 10, 1);
        ap++;
      } else if(c == 'x' || c == 'p'){
        printint(fd, *ap, 16, 0);
 4e0:	8b 44 24 1c          	mov    0x1c(%esp),%eax
 4e4:	b9 10 00 00 00       	mov    $0x10,%ecx
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
        putc(fd, c);
      }
      state = 0;
 4e9:	31 f6                	xor    %esi,%esi
    } else if(state == '%'){
      if(c == 'd'){
        printint(fd, *ap, 10, 1);
        ap++;
      } else if(c == 'x' || c == 'p'){
        printint(fd, *ap, 16, 0);
 4eb:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
 4f2:	8b 10                	mov    (%eax),%edx
 4f4:	89 e8                	mov    %ebp,%eax
 4f6:	e8 b5 fe ff ff       	call   3b0 <printint>
        ap++;
 4fb:	83 44 24 1c 04       	addl   $0x4,0x1c(%esp)
 500:	e9 62 ff ff ff       	jmp    467 <printf+0x37>
 505:	8d 76 00             	lea    0x0(%esi),%esi
      } else if(c == 's'){
        s = (char*)*ap;
 508:	8b 44 24 1c          	mov    0x1c(%esp),%eax
 50c:	8b 38                	mov    (%eax),%edi
        ap++;
 50e:	83 c0 04             	add    $0x4,%eax
 511:	89 44 24 1c          	mov    %eax,0x1c(%esp)
        if(s == 0)
 515:	85 ff                	test   %edi,%edi
 517:	74 64                	je     57d <printf+0x14d>
          s = "(null)";
        while(*s != 0){
 519:	0f b6 17             	movzbl (%edi),%edx
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
        putc(fd, c);
      }
      state = 0;
 51c:	31 f6                	xor    %esi,%esi
      } else if(c == 's'){
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
 51e:	84 d2                	test   %dl,%dl
 520:	0f 84 41 ff ff ff    	je     467 <printf+0x37>
 526:	66 90                	xchg   %ax,%ax
          putc(fd, *s);
 528:	0f be d2             	movsbl %dl,%edx
          s++;
 52b:	83 c7 01             	add    $0x1,%edi
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
          putc(fd, *s);
 52e:	89 e8                	mov    %ebp,%eax
 530:	e8 4b fe ff ff       	call   380 <putc>
      } else if(c == 's'){
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
        while(*s != 0){
 535:	0f b6 17             	movzbl (%edi),%edx
 538:	84 d2                	test   %dl,%dl
 53a:	75 ec                	jne    528 <printf+0xf8>
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
        putc(fd, c);
      }
      state = 0;
 53c:	31 f6                	xor    %esi,%esi
 53e:	eb 85                	jmp    4c5 <printf+0x95>
      } else {
        putc(fd, c);
      }
    } else if(state == '%'){
      if(c == 'd'){
        printint(fd, *ap, 10, 1);
 540:	8b 44 24 1c          	mov    0x1c(%esp),%eax
 544:	b1 0a                	mov    $0xa,%cl
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
        putc(fd, c);
      }
      state = 0;
 546:	66 31 f6             	xor    %si,%si
      } else {
        putc(fd, c);
      }
    } else if(state == '%'){
      if(c == 'd'){
        printint(fd, *ap, 10, 1);
 549:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
 550:	8b 10                	mov    (%eax),%edx
 552:	89 e8                	mov    %ebp,%eax
 554:	e8 57 fe ff ff       	call   3b0 <printint>
        ap++;
 559:	83 44 24 1c 04       	addl   $0x4,0x1c(%esp)
 55e:	e9 04 ff ff ff       	jmp    467 <printf+0x37>
        while(*s != 0){
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
        putc(fd, *ap);
 563:	8b 44 24 1c          	mov    0x1c(%esp),%eax
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
        putc(fd, c);
      }
      state = 0;
 567:	31 f6                	xor    %esi,%esi
        while(*s != 0){
          putc(fd, *s);
          s++;
        }
      } else if(c == 'c'){
        putc(fd, *ap);
 569:	0f be 10             	movsbl (%eax),%edx
 56c:	89 e8                	mov    %ebp,%eax
 56e:	e8 0d fe ff ff       	call   380 <putc>
        ap++;
 573:	83 44 24 1c 04       	addl   $0x4,0x1c(%esp)
 578:	e9 ea fe ff ff       	jmp    467 <printf+0x37>
        ap++;
      } else if(c == 's'){
        s = (char*)*ap;
        ap++;
        if(s == 0)
          s = "(null)";
 57d:	bf ff 06 00 00       	mov    $0x6ff,%edi
 582:	eb 95                	jmp    519 <printf+0xe9>
 584:	90                   	nop
 585:	90                   	nop
 586:	90                   	nop
 587:	90                   	nop
 588:	90                   	nop
 589:	90                   	nop
 58a:	90                   	nop
 58b:	90                   	nop
 58c:	90                   	nop
 58d:	90                   	nop
 58e:	90                   	nop
 58f:	90                   	nop

00000590 <free>:
static Header base;
static Header *freep;

void
free(void *ap)
{
 590:	57                   	push   %edi
  Header *bp, *p;

  bp = (Header*) ap - 1;
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 591:	a1 b4 09 00 00       	mov    0x9b4,%eax
static Header base;
static Header *freep;

void
free(void *ap)
{
 596:	56                   	push   %esi
 597:	53                   	push   %ebx
 598:	8b 5c 24 10          	mov    0x10(%esp),%ebx
  Header *bp, *p;

  bp = (Header*) ap - 1;
 59c:	8d 4b f8             	lea    -0x8(%ebx),%ecx
 59f:	90                   	nop
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 5a0:	39 c8                	cmp    %ecx,%eax
 5a2:	8b 10                	mov    (%eax),%edx
 5a4:	73 04                	jae    5aa <free+0x1a>
 5a6:	39 d1                	cmp    %edx,%ecx
 5a8:	72 16                	jb     5c0 <free+0x30>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
 5aa:	39 d0                	cmp    %edx,%eax
 5ac:	72 08                	jb     5b6 <free+0x26>
 5ae:	39 c8                	cmp    %ecx,%eax
 5b0:	72 0e                	jb     5c0 <free+0x30>
 5b2:	39 d1                	cmp    %edx,%ecx
 5b4:	72 0a                	jb     5c0 <free+0x30>
static Header base;
static Header *freep;

void
free(void *ap)
{
 5b6:	89 d0                	mov    %edx,%eax
 5b8:	eb e6                	jmp    5a0 <free+0x10>
 5ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

  bp = (Header*) ap - 1;
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
      break;
  if(bp + bp->s.size == p->s.ptr){
 5c0:	8b 73 fc             	mov    -0x4(%ebx),%esi
 5c3:	8d 3c f1             	lea    (%ecx,%esi,8),%edi
 5c6:	39 d7                	cmp    %edx,%edi
 5c8:	74 18                	je     5e2 <free+0x52>
    bp->s.size += p->s.ptr->s.size;
    bp->s.ptr = p->s.ptr->s.ptr;
  } else
    bp->s.ptr = p->s.ptr;
 5ca:	89 53 f8             	mov    %edx,-0x8(%ebx)
  if(p + p->s.size == bp){
 5cd:	8b 50 04             	mov    0x4(%eax),%edx
 5d0:	8d 34 d0             	lea    (%eax,%edx,8),%esi
 5d3:	39 f1                	cmp    %esi,%ecx
 5d5:	74 22                	je     5f9 <free+0x69>
    p->s.size += bp->s.size;
    p->s.ptr = bp->s.ptr;
  } else
    p->s.ptr = bp;
 5d7:	89 08                	mov    %ecx,(%eax)
  freep = p;
 5d9:	a3 b4 09 00 00       	mov    %eax,0x9b4
}
 5de:	5b                   	pop    %ebx
 5df:	5e                   	pop    %esi
 5e0:	5f                   	pop    %edi
 5e1:	c3                   	ret    
  bp = (Header*) ap - 1;
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
      break;
  if(bp + bp->s.size == p->s.ptr){
    bp->s.size += p->s.ptr->s.size;
 5e2:	03 72 04             	add    0x4(%edx),%esi
 5e5:	89 73 fc             	mov    %esi,-0x4(%ebx)
    bp->s.ptr = p->s.ptr->s.ptr;
 5e8:	8b 10                	mov    (%eax),%edx
 5ea:	8b 12                	mov    (%edx),%edx
 5ec:	89 53 f8             	mov    %edx,-0x8(%ebx)
  } else
    bp->s.ptr = p->s.ptr;
  if(p + p->s.size == bp){
 5ef:	8b 50 04             	mov    0x4(%eax),%edx
 5f2:	8d 34 d0             	lea    (%eax,%edx,8),%esi
 5f5:	39 f1                	cmp    %esi,%ecx
 5f7:	75 de                	jne    5d7 <free+0x47>
    p->s.size += bp->s.size;
 5f9:	03 53 fc             	add    -0x4(%ebx),%edx
    p->s.ptr = bp->s.ptr;
  } else
    p->s.ptr = bp;
  freep = p;
 5fc:	a3 b4 09 00 00       	mov    %eax,0x9b4
    bp->s.size += p->s.ptr->s.size;
    bp->s.ptr = p->s.ptr->s.ptr;
  } else
    bp->s.ptr = p->s.ptr;
  if(p + p->s.size == bp){
    p->s.size += bp->s.size;
 601:	89 50 04             	mov    %edx,0x4(%eax)
    p->s.ptr = bp->s.ptr;
 604:	8b 53 f8             	mov    -0x8(%ebx),%edx
 607:	89 10                	mov    %edx,(%eax)
  } else
    p->s.ptr = bp;
  freep = p;
}
 609:	5b                   	pop    %ebx
 60a:	5e                   	pop    %esi
 60b:	5f                   	pop    %edi
 60c:	c3                   	ret    
 60d:	8d 76 00             	lea    0x0(%esi),%esi

00000610 <malloc>:
  return freep;
}

void*
malloc(uint nbytes)
{
 610:	57                   	push   %edi
 611:	56                   	push   %esi
 612:	53                   	push   %ebx
 613:	83 ec 10             	sub    $0x10,%esp
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
  if((prevp = freep) == 0){
 616:	8b 15 b4 09 00 00    	mov    0x9b4,%edx
malloc(uint nbytes)
{
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
 61c:	8b 5c 24 20          	mov    0x20(%esp),%ebx
 620:	83 c3 07             	add    $0x7,%ebx
 623:	c1 eb 03             	shr    $0x3,%ebx
 626:	83 c3 01             	add    $0x1,%ebx
  if((prevp = freep) == 0){
 629:	85 d2                	test   %edx,%edx
 62b:	0f 84 9d 00 00 00    	je     6ce <malloc+0xbe>
 631:	8b 02                	mov    (%edx),%eax
 633:	8b 48 04             	mov    0x4(%eax),%ecx
    base.s.ptr = freep = prevp = &base;
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
    if(p->s.size >= nunits){
 636:	39 d9                	cmp    %ebx,%ecx
 638:	73 6e                	jae    6a8 <malloc+0x98>
        p->s.size -= nunits;
        p += p->s.size;
        p->s.size = nunits;
      }
      freep = prevp;
      return (void*) (p + 1);
 63a:	8d 3c dd 00 00 00 00 	lea    0x0(,%ebx,8),%edi
 641:	eb 0e                	jmp    651 <malloc+0x41>
 643:	90                   	nop
 644:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
  if((prevp = freep) == 0){
    base.s.ptr = freep = prevp = &base;
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 648:	8b 02                	mov    (%edx),%eax
    if(p->s.size >= nunits){
 64a:	8b 48 04             	mov    0x4(%eax),%ecx
 64d:	39 cb                	cmp    %ecx,%ebx
 64f:	76 57                	jbe    6a8 <malloc+0x98>
        p->s.size = nunits;
      }
      freep = prevp;
      return (void*) (p + 1);
    }
    if(p == freep)
 651:	3b 05 b4 09 00 00    	cmp    0x9b4,%eax
 657:	89 c2                	mov    %eax,%edx
 659:	75 ed                	jne    648 <malloc+0x38>
morecore(uint nu)
{
  char *p;
  Header *hp;

  if(nu < PAGE)
 65b:	81 fb ff 0f 00 00    	cmp    $0xfff,%ebx
 661:	b8 00 80 00 00       	mov    $0x8000,%eax
    nu = PAGE;
 666:	be 00 10 00 00       	mov    $0x1000,%esi
morecore(uint nu)
{
  char *p;
  Header *hp;

  if(nu < PAGE)
 66b:	76 04                	jbe    671 <malloc+0x61>
 66d:	89 f8                	mov    %edi,%eax
 66f:	89 de                	mov    %ebx,%esi
    nu = PAGE;
  p = sbrk(nu * sizeof(Header));
 671:	89 04 24             	mov    %eax,(%esp)
 674:	e8 f3 fc ff ff       	call   36c <sbrk>
  if(p == (char*) -1)
 679:	83 f8 ff             	cmp    $0xffffffff,%eax
 67c:	74 1a                	je     698 <malloc+0x88>
    return 0;
  hp = (Header*)p;
  hp->s.size = nu;
 67e:	89 70 04             	mov    %esi,0x4(%eax)
  free((void*)(hp + 1));
 681:	83 c0 08             	add    $0x8,%eax
 684:	89 04 24             	mov    %eax,(%esp)
 687:	e8 04 ff ff ff       	call   590 <free>
  return freep;
 68c:	8b 15 b4 09 00 00    	mov    0x9b4,%edx
      }
      freep = prevp;
      return (void*) (p + 1);
    }
    if(p == freep)
      if((p = morecore(nunits)) == 0)
 692:	85 d2                	test   %edx,%edx
 694:	75 b2                	jne    648 <malloc+0x38>
 696:	66 90                	xchg   %ax,%ax
        return 0;
  }
}
 698:	83 c4 10             	add    $0x10,%esp
      freep = prevp;
      return (void*) (p + 1);
    }
    if(p == freep)
      if((p = morecore(nunits)) == 0)
        return 0;
 69b:	31 c0                	xor    %eax,%eax
  }
}
 69d:	5b                   	pop    %ebx
 69e:	5e                   	pop    %esi
 69f:	5f                   	pop    %edi
 6a0:	c3                   	ret    
 6a1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    base.s.ptr = freep = prevp = &base;
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
    if(p->s.size >= nunits){
      if(p->s.size == nunits)
 6a8:	39 cb                	cmp    %ecx,%ebx
 6aa:	74 1c                	je     6c8 <malloc+0xb8>
        prevp->s.ptr = p->s.ptr;
      else {
        p->s.size -= nunits;
 6ac:	29 d9                	sub    %ebx,%ecx
 6ae:	89 48 04             	mov    %ecx,0x4(%eax)
        p += p->s.size;
 6b1:	8d 04 c8             	lea    (%eax,%ecx,8),%eax
        p->s.size = nunits;
 6b4:	89 58 04             	mov    %ebx,0x4(%eax)
      }
      freep = prevp;
 6b7:	89 15 b4 09 00 00    	mov    %edx,0x9b4
    }
    if(p == freep)
      if((p = morecore(nunits)) == 0)
        return 0;
  }
}
 6bd:	83 c4 10             	add    $0x10,%esp
        p->s.size -= nunits;
        p += p->s.size;
        p->s.size = nunits;
      }
      freep = prevp;
      return (void*) (p + 1);
 6c0:	83 c0 08             	add    $0x8,%eax
    }
    if(p == freep)
      if((p = morecore(nunits)) == 0)
        return 0;
  }
}
 6c3:	5b                   	pop    %ebx
 6c4:	5e                   	pop    %esi
 6c5:	5f                   	pop    %edi
 6c6:	c3                   	ret    
 6c7:	90                   	nop
    base.s.size = 0;
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
    if(p->s.size >= nunits){
      if(p->s.size == nunits)
        prevp->s.ptr = p->s.ptr;
 6c8:	8b 08                	mov    (%eax),%ecx
 6ca:	89 0a                	mov    %ecx,(%edx)
 6cc:	eb e9                	jmp    6b7 <malloc+0xa7>
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
  if((prevp = freep) == 0){
    base.s.ptr = freep = prevp = &base;
 6ce:	c7 05 b4 09 00 00 b8 	movl   $0x9b8,0x9b4
 6d5:	09 00 00 
    base.s.size = 0;
 6d8:	b8 b8 09 00 00       	mov    $0x9b8,%eax
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
  if((prevp = freep) == 0){
    base.s.ptr = freep = prevp = &base;
 6dd:	c7 05 b8 09 00 00 b8 	movl   $0x9b8,0x9b8
 6e4:	09 00 00 
    base.s.size = 0;
 6e7:	c7 05 bc 09 00 00 00 	movl   $0x0,0x9bc
 6ee:	00 00 00 
 6f1:	e9 44 ff ff ff       	jmp    63a <malloc+0x2a>
